package com.mmall.dao;

import com.mmall.pojo.Cart;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface CartMapperCustom {

    Cart selectCartByUserIdProductId(@Param("userId") Integer userId,
                                     @Param("productId") Integer productId);

    List<Cart> selectCartByUserId(Integer userId);

    int selectCartProductCheckedStatusByUserId(Integer userId);

    int deleteByUserIdProductIds(@Param("userId") Integer userId,
                                 @Param("productIdList") List<String> productIdList);

    int checkedOrUncheckedProduct(@Param("userId") Integer userId,
                                  @Param("checked") Integer checked,
                                  @Param("productId") Integer productId);

    int selectCartProductCount(@Param("userId") Integer userId);
}